<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: ll
  Date: 2022/9/19
  Time: 11:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
hello
<hr>request
<%
    //再从当前页面取出数据
    List<String> books = (List<String>) request.getAttribute("r1");
    if(books != null) {
        for (String book : books) {
            out.println(book + "<br>");
        }
    }else{
        out.println("wu!");
    }
%>
<hr>session
<%
    //3. 再从当前页面取出数据
    books = (List<String>) session.getAttribute("books");
    out.println("sessionId:" + session.getId() + "<br>");
    if(books != null) {
        for (String book : books) {
            out.println(book + "<br>");
        }
    }
%>
</body>
</html>
